<?php

namespace app\api\service;

use app\api\model\AdminuserModel;
use think\Db;
use think\Request;

class AdminuserService{



    public static function getAllUsers()
    {
        $data = Db::table('adminuser')
            ->where('id', '>=', 1)
            ->limit(3)
            ->select();
        $data2=AdminuserModel::get(1);
        return $data2;
    }

    public static function getUserById($id){
        $tmp1=(int)$id;
        $tmp = AdminuserModel::get($tmp1);
        return $tmp;
        //return AdminuserModel::get($id);
    }

    public static function getUserById2($id2){
        $tmp = (int)$id2;
        if($tmp>0){
            return AdminuserModel::get($tmp);
        }else{
            reutrn -1;
        }

    }
}